<?php include('includes/connect.php'); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<title>Infographics</title>
</head>

<body>

<form name="info" id="info" method="post" action="quotient_process.php">
	
	<table border="0" width="40%">
	<tr>
	<td valign="top">Select User</td>
		<td>
		<select name="user" id="user">
			<option value="">-select user-</option>
			<option value="user1">user1</option>
			<option value="user2">user2</option>
			<option value="user3">user3</option>
			<option value="user4">user4</option>
			<option value="user5">user5</option>
		</select><br/><br/>
		</td>
	</tr>
		<tr>
		<td colspan="2">
				
						<?php 
							 $sr="1";
							 $i=1;
						 $questions=mysql_query("select * from questions where app_id='2' order by RAND() limit 1");
								$row_count=mysql_num_rows($questions);			
						 while($row=mysql_fetch_array($questions)) {
						 $que_id=$row["qid"];
						 $que=$row["questions"];
						 
							echo '&nbsp;&nbsp;'.$sr.')&nbsp'.'<input type="hidden" name="questions'.$i.'" value="'.$que_id.'">'.$que.'<br>'; 
							$sr++;
								$opt=mysql_query("select * from options as o ,questions as q where q.qid=o.qid and q.qid=$que_id"); 
								while($opt_row=mysql_fetch_array($opt))
								{
								
								$opt_id=$opt_row['opt_id'];
								echo '&nbsp;&nbsp;<input type="radio" name="options'.$i.'" value="'.$opt_id.'">'.$opt_row['option'].'<br>';
								}
								echo '<br>';
								 $i++;
						 } 
						 echo '<input type="hidden" value="'.$row_count.'" name="count" id="count"/>';
						 ?>
						 
		
		</td>
		</tr>
		
		<tr><td colspan="2"><input type="submit" value="submit" class="submit"/></td></tr>
		
	</table>
	</form>
	</body>
</html>
